﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using University.Workshop.Presenters.Cistern.Read;

namespace University.Workshop.Presentation.Cistern.Read
{
    /// <summary>
    /// Interaction logic for ReadCisternPrincipalData.xaml
    /// </summary>
    public partial class ReadCisternPrincipalData : Page, Presenters.Cistern.Read.IReadPrincipalView
    {
        PresenterReadCistern pReadCisternView;
        public ReadCisternPrincipalData(Model.Cistern cistern)
        {
            InitializeComponent();
            this.pReadCisternView = new PresenterReadCistern(this, cistern);
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            frmContent.Navigate(new PageFirstStepReadCisternView(pReadCisternView));
            pReadCisternView.FirstTime();
        }

        private void GoStepOne_Click(object sender, RoutedEventArgs e)
        {
            pReadCisternView.GoStepOne();
        }

        private void GoStepTwo_Click(object sender, RoutedEventArgs e)
        {
            pReadCisternView.GoStepTwo();
        }

        public void CallFirstPage()
        {

            PageSecondStepReadCisternView pp = new PageSecondStepReadCisternView(pReadCisternView);
            RedBasic = pp;
            frmContent.NavigationService.Navigate(pp);
            
        }


        public void CallSecondPage()
        {
            PageFirstStepReadCisternView pp = new PageFirstStepReadCisternView(pReadCisternView);
            RedBasic = pp;
            frmContent.NavigationService.Navigate(pp);
            GoStepTwo.IsEnabled = true;
        }


        public IReadBasicCistern RedBasic
        {
            get;
            set;
        }

        private void NextBtn_Click(object sender, RoutedEventArgs e)
        {
            pReadCisternView.GoNextPage();
        }

        private void BackBtn_Click(object sender, RoutedEventArgs e)
        {
            pReadCisternView.GoBackPage();
        }
    }
}
